<?php

	$id=$_GET['id'];
	$id=url_decode($id,'album');
	$cache=new Cache;
	$data['album']=cache_get_album($id);
	$sql ="select id,cat_id,post_id,username,id_album ,is_image,is_video,is_text from index_post where id_album=".$id." order by id desc";
	$sql2="select id from index_post where id_album=".$id;

	$pager = new Pagination($sql,LOAD_ITEMS,4,"",5,"post");
	$pager->setDebug(false);
	$data[info] = $pager->paginate($cache,$sql2);
	$data[nav]	= $pager->renderFullNav();
	$data['page']=$pager->get_num_page();
	
	$_SESSION['load']['query']=$sql;
	$_SESSION['load']['tpage']=$data['page'];
	
	if(!isset($_GET['page']) || $_GET['page']==1 || $_GET['page']% LOAD_TIME ==0){
			
				$data1[title]=web_title($data['album']['name'],'album');
				loadview('template/header',$data1);
		loadview("news/view_album",$data);
		
	}else{
		exit();
	}



	

?>